<?php
defined('SYSPATH') OR die('No direct access allowed.');
/**
 * detail.php
 * @author ranuandra
 *
 * 15 Agu 2011 13:58:43
 *
 * 
 */
if(!isset($post['submit']))
{
?>

<table  class="data" class="center">
	<thead>
		<tr>
			<th colspan="3">DATA CUSTOMER</th>
		</tr>
	</thead>
	<tr>
		<td>PEMILIK</td>
		<td>:</td>
		<td> <?php echo $customer->nama?></td>
	</tr>
	<tr>
		<td>ALAMAT</td>
		<td>:</td>
		<td> <?php echo $customer->alamat?></td>
	</tr>
</table>
<?php 
		if(isset($header))
		{
		
				echo $header;
		}
}
?>
<div class="tbldata">
<table class="data tablesorter" class="center">
	<thead>
		<tr>
			<th>Tahun</th>
			<th>Model</th>
			<th>Merk</th>
			<th>Type</th>
			<th>Jumlah Kendaraan</th>
		</tr>
	<thead>
	<tbody>
<?php 
//print_r($datas);
if(isset($tahuns))
{
	//print_r($datas);
//print_r($datas);
	//$mobils = $datas->polreg->find_all();
	
	foreach($tahuns as $tahun)
	{
		
		$first = 0;
		$polreg = new Model_Report();
		
		$datas = $polreg->detail_customer($post, $tahun);
		foreach($datas as $data)
		{
			echo "<tr>";
			//print_r($data);
			if($first==0)
			{
				echo "<td>".$tahun['tahun']."</td>";
				
			}
			else 
			{
				echo "<td></td>";
				
			}
	?>

				<td><?php echo $data['model'] ?></td>
				<td><?php echo $data['merk'] ?></td>
				<td><?php echo $data['type'] ?></td>
				<td><?php echo $data['jumlah'] ?></td>
			</tr>
	<?php 
				$first = 1;
		}
	}
}
	?>
	</tbody>
</table>
</div>